<%-- 
    Document   : RegisterUser
    Created on : Nov 16, 2014, 7:01:33 PM
    Author     : user
--%>


<%@page import="java.sql.*"%>
<%@page import="newpackage.ConnectionFactory"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        
        <script type="text/javascript">
           document.forms["verify_file"].submit();
        </script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body background="image.jpg">
        <h1> ENSURING PRIVACY AND DATA FRESHNESS OF SHARED DATA IN CLOUD </h1>
        <center>
        <form name="register_user" id="register_user" onsubmit="submitForm();">
            <table>
<!--                <tr>   
                    <td>
            Admin's Email Id E-mail : <input type="text" name="e_mail"/>
                    </td>
                
                </tr>   -->
                    <tr>
                        <td>
          User Id (Unique Email Id) :<input type="text" name="user_1"/>
                        </td>
                        <td>
            password  :<input type="password" name="user_1pass"/>
                        </td>
                        <td>
           Email  :<input type="email" name="user_1email"/>
                        </td>
                    </tr>
<!--                     <tr>
                        <td>
            User2 User Id  (Unique Email Id) :<input type="text" name="user_2"/>
                        </td>
                        <td>
            User2 password  :<input type="password" name="user_2pass"/>
                        </td>
                        <td>
            User2 Email  :<input type="email" name="user_2email"/>
                        </td>
                    </tr>
                     <tr>
                        <td>
            User3 User Id  (Unique Email Id) :<input type="text" name="user_3"/>
                        </td>
                        <td>
            User3 password  :<input type="password" name="user_3pass"/>
                        </td>
                        <td>
            User3 Email  :<input type="email" name="user_3email"/>
                        </td>
                    </tr>
            -->
            </table>
            <input type="submit" value="register"/>
            <%
         //   String e_mail=request.getParameter("e_mail");
            String user_1=request.getParameter("user_1");
          //  String user_2=request.getParameter("user_2");
           // String user_3=request.getParameter("user_3");
            String user_1pass=request.getParameter("user_1pass");
            //String user_2pass=request.getParameter("user_2pass");
          //  String user_3pass=request.getParameter("user_3pass");
            String user_1email=request.getParameter("user_1email");
         //   String user_2email=request.getParameter("user_2email");
        //    String user_3email=request.getParameter("user_3email");
        //    if((e_mail!=null)&&(user_1!=null)&&(user_2!=null)&&(user_3!=null))
            if((user_1!=null))
            {
                Connection c=ConnectionFactory.getConnection();
                Statement s=c.createStatement();
               // String query="Insert into user_details(user_name,password,email) values('"+e_mail+"','"+e_mail+"','"+e_mail+"')";
                
                String query1="Insert into user_details(user_name,password,email) values('"+user_1+"','"+user_1pass+"','"+user_1email+"')";
                
               // String query2="Insert into user_details(user_name,password,email) values('"+user_2+"','"+user_2pass+"','"+user_2email+"')";
                
             //   String query3="Insert into user_details(user_name,password,email) values('"+user_3+"','"+user_3pass+"','"+user_3email+"')";
                
                
              // s.addBatch(query);
                
               s.addBatch(query1);
                
                // s.addBatch(query2);
                 
               //  s.addBatch(query3);
                 
                 s.executeBatch();
                
            }


%>
        </form>
        </center>
    <a href="index.jsp">Home</a>
    </body>
</html>
